#include "CloudiskServer.h"
#include "LoadConfig.h"
#include "OssManager.h"

int main(){
    OssManager::init();

    CloudiskServer server;
    server.register_modules();

    int port = std::stoi(LoadConfig::loadConfig()["PORT"]);
    std::cout << "[PORT]" << port << std::endl; 
    if(server.track().start(port)==0){
        server.list_routes();
        server.stop();
    }else{
        std::cerr << "server started failed!" << std::endl;
    }

    OssManager::shutdown();

    return 0;
}
